1 /* 2 3 Boost Software License - Version 1.0 - August 17th, 2003 4 5 Permission is hereby granted, free of charge, to any person or organization 6 obtaining a copy of the software and accompanying documentation covered by 7 this license (the "Software") to use, reproduce, display, distribute, 8 execute, and transmit the Software, and to prepare derivative works of the 9 Software, and to permit third-parties to whom the Software is furnished to 10 do so, all subject to the following: 11 12 The copyright notices in the Software and this entire statement, including 13 the above license grant, this restriction and the following disclaimer, 14 must be included in all copies of the Software, in whole or in part, and 15 all derivative works of the Software, unless such copies or derivative 16 works are solely in the form of machine-executable object code generated by 17 a source language processor. 18 19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 DEALINGS IN THE SOFTWARE. 26 27 */ 28 29 module derelict.glib.gslice; 30 31 import derelict.glib.gtypes; 32 import derelict.glib.glibconfig; 33 import core.stdc.config; 34 35 extern (C): 36 37 alias _Anonymous_0 GSliceConfig; 38 39 enum _Anonymous_0 40 { 41 G_SLICE_CONFIG_ALWAYS_MALLOC = 1, 42 G_SLICE_CONFIG_BYPASS_MAGAZINES = 2, 43 G_SLICE_CONFIG_WORKING_SET_MSECS = 3, 44 G_SLICE_CONFIG_COLOR_INCREMENT = 4, 45 G_SLICE_CONFIG_CHUNK_SIZES = 5, 46 G_SLICE_CONFIG_CONTENTION_COUNTER = 6 47 } 48 49 50 version(Derelict_Link_Static) 51 { 52 extern( C ) nothrow 53 { 54 gpointer g_slice_alloc(gsize block_size); 55 gpointer g_slice_alloc0(gsize block_size); 56 gpointer g_slice_copy(gsize block_size, gconstpointer mem_block); 57 void g_slice_free1(gsize block_size, gpointer mem_block); 58 void g_slice_free_chain_with_offset(gsize block_size, gpointer mem_chain, gsize next_offset); 59 void g_slice_set_config(GSliceConfig ckey, gint64 value); 60 gint64 g_slice_get_config(GSliceConfig ckey); 61 gint64* g_slice_get_config_state(GSliceConfig ckey, gint64 address, guint* n_values); 62 } 63 } 64 else 65 { 66 extern( C ) nothrow 67 { 68 alias da_g_slice_alloc = gpointer function(gsize block_size); 69 alias da_g_slice_alloc0 = gpointer function(gsize block_size); 70 alias da_g_slice_copy = gpointer function(gsize block_size, gconstpointer mem_block); 71 alias da_g_slice_free1 = void function(gsize block_size, gpointer mem_block); 72 alias da_g_slice_free_chain_with_offset = void function(gsize block_size, gpointer mem_chain, gsize next_offset); 73 alias da_g_slice_set_config = void function(GSliceConfig ckey, gint64 value); 74 alias da_g_slice_get_config = gint64 function(GSliceConfig ckey); 75 alias da_g_slice_get_config_state = gint64* function(GSliceConfig ckey, gint64 address, guint* n_values); 76 } 77 78 __gshared 79 { 80 da_g_slice_alloc g_slice_alloc; 81 da_g_slice_alloc0 g_slice_alloc0; 82 da_g_slice_copy g_slice_copy; 83 da_g_slice_free1 g_slice_free1; 84 da_g_slice_free_chain_with_offset g_slice_free_chain_with_offset; 85 da_g_slice_set_config g_slice_set_config; 86 da_g_slice_get_config g_slice_get_config; 87 da_g_slice_get_config_state g_slice_get_config_state; 88 } 89 }